<?php
/*----------------------------------------------------------------------------------------*/
/*--------- La classe évènement utilisée pour ranger les données 'parsées'  --------------*/
/*----------------------------------------------------------------------------------------*/

class Event{	 
	private $module;
	private $date;
	private $day;
	private $starttime;
	private $endtime;
	private $category;
	private $rooms;
	private $notes;


	public function __construct (){
	}

	public function __toString(){
		return "[".$this->module.", ".$this->date.", ".$this->day.", ".$this->starttime.", ".$this->endtime.", ".$this->category.", ".$this->rooms."]";
	}

	public function getModule(){
		return $this->module;
	}

	public function setModule($module){
		$this->module = $module;
	}

	public function getDate(){
		return $this->date;
	}

	public function setDate($date){
		$this->date = $date;
	}

	public function getDay(){
		return $this->day;
	}

	public function setDay($day){
		$this->day = $day;
	}

	public function getStartTime(){
		return $this->starttime;
	}

	public function setStartTime($starttime){
		$this->starttime = $starttime;
	}

	public function getEndTime(){
		return $this->endtime;
	}

	public function setEndTime($endtime){
		$this->endtime = $endtime;
	}

	public function getCategory(){
		return $this->category;
	}

	public function setCategory($category){
		$this->category = $category;
	}

	public function getRooms(){
		return $this->rooms;
	}

	public function setRooms($rooms){
		$this->rooms = $rooms;
	}

	public function getNotes(){
		return $this->notes;
	}

	public function setNotes($notes){
		$this->notes = $notes;
	}

	public function getRealDate(){
		$jour = substr($this->date, 0, 2);
		$mois  = substr($this->date, 3, 2);
		$annee = substr($this->date, 6, 4);

		$jour += $this->day;

		//jj/mm/aaaa
		if($jour >= 10)
		return $jour."/".$mois."/".$annee;
		else
		return "0".$jour."/".$mois."/".$annee;
	}
}
?>
